const mongoose = require("mongoose");
const btnRoleSchema = new mongoose.Schema({
    menuId: {
        type:String,
    },
    color:String,
    code:{
        type:String,
        unique: true,
        required:true
    },
    name: {
        type:String,
    },
});

const menuSchema = new mongoose.Schema({
    name: String,
    path: {
        type: String,
        // unique: true,
    },
    isMenu:Boolean,
    disabled:Boolean,
    order:Number,
    alias:{
        type: String,
         unique: true,
    },
    parentId: String,
    btnRoles: [btnRoleSchema]
});
const menu = mongoose.model("menu", menuSchema);
module.exports = {
    menu
};
